import request from '@/utils/request'

// 创建题库信息
export function createBank(data) {
  return request({
    url: '/question/bank/create',
    method: 'post',
    data: data
  })
}

// 更新题库信息
export function updateBank(data) {
  return request({
    url: '/question/bank/update',
    method: 'put',
    data: data
  })
}

// 删除题库信息
export function deleteBank(id) {
  return request({
    url: '/question/bank/delete?id=' + id,
    method: 'delete'
  })
}

// 获得题库信息
export function getBank(id) {
  return request({
    url: '/question/bank/get?id=' + id,
    method: 'get'
  })
}

// 获得题库信息分页
export function getBankPage(query) {
  return request({
    url: '/question/bank/page',
    method: 'get',
    params: query
  })
}

// 获得题库信息列表
export function getBankList() {
  return request({
    url: '/question/bank/allList',
    method: 'get'
  })
}

// 导出题库信息 Excel
export function exportBankExcel(query) {
  return request({
    url: '/question/bank/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
